package com.rc.evcharger.task;

import com.rc.evcharger.common.base.BaseTask;
import com.rc.evcharger.redis.RedOrderService;
import com.rc.evcharger.service.elec.ElecPileService;
import com.rc.evcharger.service.member.MemberInfoService;
import com.rc.evcharger.service.order.OrderInfoService;
import io.netty.util.HashedWheelTimer;
import io.netty.util.Timeout;
import io.netty.util.Timer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

@Component
public class SupperTask implements BaseTask {
    @Autowired
    private OrderInfoService orderService;

    @Autowired
    private MemberInfoService memberService;

    @Autowired
    private ElecPileService pileService;

    @Autowired
    private RedOrderService redOrderService;

    Timer timer = new HashedWheelTimer();

    @Override
    public void run(Timeout timeout) throws Exception {
        runTask(timeout);

    }

    @Override
    public void runTask(Timeout timeout) throws Exception {

    }

    @Override
    public void addTask(String rtua, String gunNum, Integer time, TimeUnit tu) {

    }

    @Override
    public void addTask(String rtua, String gunNum, String orderNum, Integer time, TimeUnit tu) {

    }


    @Override
    public void removeTask(String key) {

    }

    @Override
    public void removeTask(String... keys) {

    }

    /**
     * 校对订单的第二位字符串
     *
     * @param orderNum
     * @param stopReason
     * @return
     */
    public String orderStopReason(String orderNum, String stopReason) {
        StringBuilder sb = new StringBuilder(orderNum);
        sb.replace(16, 17, stopReason);
        return sb.toString();
    }
}
